import React from 'react';
import { observer, inject } from 'mobx-react';
import { Accordion } from 'weaver-mobile';
import { toJS } from 'mobx';

@inject('createProjectStore')
@observer
export default class AccordionWraps extends React.Component {
    render() {
        const { activeKey, changeAccordionIcon } = this.props.createProjectStore;
        return (<Accordion
            accordion={false}
            activeKey={toJS(activeKey)}
            className="my-accordion"
            onChange={(key) => {
                changeAccordionIcon(key, "true")
            }}  >
            {this.props.children}
        </Accordion>)
    }
}